﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using JeanFish.Common;

namespace JeanFish.UnitTest.Common
{
    [TestClass]
    public class ReflectionHelperTest
    {
        [TestMethod]
        public void PropertySelectMethodTest()
        {
            DateTime date = DateTime.Now;
            int minute = date.SelectProperty(t => t.Minute);
            Assert.AreEqual(date.Minute, minute);
            var item = new { Date = DateTime.Now, Name = "Test" };
            var item2 = new { Item1 = item };
            Assert.IsTrue(item.Equals(item2.SelectProperty(_ => _.Item1)));
        }
    }
}
